﻿/// <reference path="../common/_references.js" />
var pageLogin = {
    callback: null,
    loginurl: null,
    verifyCallback: null,
    param:null,
    initFn: function (buttonId,loginUrl,param, verify, callback) {
        var that = this;
        that.callback = callback;
        that.loginurl = loginUrl;
        that.param = param;
        that.verifyCallback = verify;
        $("#" + buttonId).live(that.login);
    },  
    login: function () {
        if (!pageLogin.verifyCallback())
            return;
        $.post(pageLogin.loginurl, pageLogin.param, function (data) {
            if (data) {
                pageLogin.callback(data);
            };
        }, "json");
        return false;
    }
};